I got this right angle attachment for my drill. On it's hex key, there is a steel ball. What is it's purpose? As I can't find a hex bit that has a hole for this ball to lock into -- though I can find the opposite, a bit with a ball. Never mind that it's located on the edge of the hex, rather than on the flat end.
That ball fits into a groove that is on most bits - hex or flat or posidrive so they don't fall out.
If the bits don't have a groove then it is the spring force / friction that stops the bit from falling out.