Generally, when talking about physical position:
At = 在...
In = ...里
On = ...上 (it can also refer to things attached to the other surfaces, like clocks)
'At' is just a default word that describes a general location. It treats a location is a single point in space. If the location has any kind of area or volume, you probably need to use another proposition. For example you'd always say that you're "in a city" or "in a country", but if you're talking about cities or countries that are stops on a journey, then you can use 'at'.
Clocks hang on walls. Termites live in walls.
Grass grounds on the ground. Ants live in the ground.
If you're on a planet, you're standing on the ground. If you're in a planet, you're deep underground.
If you're sitting on a car, you're sitting on the roof (like a bird). If you're sitting on a seat, you're also sitting in the car.
When prepositions are used abstractly, you just have to think abstractly to figure out how what exactly you should be thinking.