To jam is to squeeze something tightly into a space, the way your friends might jam themselves into your tiny car.
You might have to jam an extra row of books onto your bookshelf when you run out of room. Another way to jam is to get stuck, and a jam can be a dense bunch of stuck people or things, like a traffic jam. If you play a musical instrument, you might jam, or casually improvise, with other musicians. And of course the jam you spread on your toast is a delicious, sweet fruit preserve.