There are "open" chain exercises, and "closed" chain exercises.
An open chain exercise is where you create force, and the WEIGHT moves
A closed chain exercise is where you create force and YOU move.
They will both work the same muscle. Action will be initiated however from the opposite end of the working muscle in an open chain exercise as opposed to a closed.
A squat would be the second of the two. Action will initiated from the 'hip end' of the quad. working the glutes, hams, add, abd ect also.
A leg press will also work the quad but it is through leg 'extension' the hams are worked also but only in an eccentric manor. The glutes are inactive due to being sat on and the other muscles of the leg and hip complex are also not in use as stability is not an issue.
Archie