Similar to other languages (German, Latin), accusative is for a direction and movement, locative is for a location and position. However, the direction accusative meaning is becoming somewhat bookish or archaic in modern Czech.
Je v tom městě. Přišel v to město.
Je to v té krabici. Dej to v tu krabici. (more common: do té krabice)