The ruck can be complicated.
Once tackled (carriers knee hits the ground, and is held), the ball carrier can make 1 movement to place the ball, he should then release (refs don't mind if you keep it in place if there's no competition for it). The tackler has to clear himself from preventing the ball from being placed. He must be back on his feet and enter through the gate of the ruck if he wants to take further part.
The first man to the tackled player forms the offside line. He can use his hands, as there is technically no ruck. If he is a defending player, then the tackled player should in theory let go of the ball and let him pick it up. This is where a lot of penalties come from, not releasing the ball on the ground. If there was already an attacking player on his feet over the ball, then the moment a defending player is pushing against him, a ruck is formed, and no more hands allowed inside the ruck by players involved in the ruck.
Another option for a turnover here, and the one that you may be referring to, is when defending players drive over the ball, pushing all the attacking players off of it, leading to the ball now being available for the previous defending team. If everyone falls over at this point, and the ball is stuck, this can often be where the ref will reward the team who were going forwards and turnover the ball to the previously defending side, awarding them the scrum.
There's more to the ruck, but that's a large portion of it.