Got a question that's been bugging me

It’s true that the AR15 bolt doesn’t ride on a rail, right?

As the carrier moves backwards during cycling, the bolt is unlocked from the breech because of a cam pin riding a cam track on the carrier. So now the bolt is in its most outward position.

OK, when the bolt carrier and bolt are now moving forward for strip a round from the magazine and feed it into the chamber, what is there to stop the bolt from going into the carrier as it strips a round?

On an AK the bolt is riding on rails so during forward movement, it cannot rotate but the AR15 bolt doesn’t ride on rails so I’m wondering how the bolt stays in the unlocked position as it moves forward.

The cam pin keeps it from turning or moving rearward. It can’t turn into the bolt until the cam pin is over the 1/2 moon cut in the upper receiver.

The cam pin is riding in a rail cut into the top of the upper receiver.

Exactly right. If you look at the inside of a receiver you’ll see a relief cut to allow the top of the cam pin to move from the top dead center position.

And this is why when you reassemble your rifle, you need to extend the bolt to it’s farthest forward position in order for it to go into the upper.