This is a model of a pin-tumbler lock mechanism, the kind you find in pretty much every lock in the world that has a straight key with one ragged edge. This mechanism is flat and made of plastic, but it shows very clearly how all such locks work: the pins, held in place with springs, block the barrel of the lock from rotating (or in this model, sliding to the left). When the key is inserted, the pins all line up exactly with the edge of the tumbler, allowing it to rotate or slide and thereby opening the lock.
You can even try to pick the lock using the included clear acrylic lock pick.
This is a high-quality model, made from laser-cut clear and colored acrylic. Of course it's not strong enough to be actually useful as a lock, but it does lock and unlock using the key provided. The kit includes everything you need, even a mini-screwdriver. Assembly time is around 10-15 minutes.