How does collision detection work?

Blog