The difference is that an adjective placed before a noun acts as an attribute and after a noun it acts as a modifier.
There are some rules as to the position of the adjective, as follows:
Demonstrative, posessive and indefinite adjectives and articles usually go before the noun. E.g., Mis tres amigas vienen a la fiesta or Este nivel de español es intermedio.
One-word superlative adjectives go before the noun. E.g., ¿Cuál es el mejor libro que has leído?, La peor película que he visto or Es la mejor manzana que he probado. (Watch out for two-word superlatives, though, e.g., Es la maestra más paciente de toda la escuela.)
To express emphasis, you may place the "measuring" adjective before the noun, e.g., La hermosa niña de ojos azules or El asqueroso perro de mi vecino.
If you use two or more adjectives that refer to the same noun they are often placed after the noun. Examples: La mujer guapa e inteligente, La casa es grande y bonita. (There are exceptions, e.g., the García Márquez story La increíble y triste historia de la cándida Eréndira y de su abuela desalmada.)
In certain cases a change in the position of the adjective alters its meaning, as in your example. Another example is El señor pobre vs El pobre señor. In this example El señor pobre means the man has no money. El pobre señor means that the man is in a bad situation with troubles not necessarily related to money (as in "Poor guy!").
Some adjectives maintain a fixed position in the sentence: Rara vez, Alta tensión, Un verdadero caos.
There are different types of adjectives; among these we can distinguish the specificative and the explicative adjectives.
Epecificativo (limiting): those that besides giving a quality, restrict the semantic extension of the noun. They usually come after the noun. Examples: Los ojos azules, El auto violeta (Not verde, not rojo. Violeta!) They are adjectives of relationship, for instance a nationality or a quality that can't be changed. Él es un señor Africano, Él es un hombre blanco, Un nadador colombiano.
Explicativo (explanatory: They don't limit the extension of the noun, but distinguish or attribute a quality to the noun. They usually come before the noun: La verde hoja, La blanca nieve, La esbelta figura.
Source: livingspanish.com