The tips of each bit are shaped to match the recessed part of the screws they are designed to operate,
The allen key bits are hexagonal and the screwdriver bits are flat.
As the shape of the bit matches the indentation in the screw, it allows the tool to fit snugly into it. This means that turning the handle will cause the screw to rotate.