The celia on some hair-cells on the Basilar Membrane are bent by each sound wave that enters the fluid.
There are other cells in the Cochlea, but their function is to support the hair-cells and the transduction process. It's a pretty nice life for a hair-cell except for one inconvenience. Their celia (hairs) are embedded in another membrane called the Tectorial Membrane.
In our classroom model, this would be analogous to a large role of fly-paper stretched from the front to the back of the room across the heads of everyone sitting on the Basilar Membrane.
Hence, when a sound wave is transmitted into the room by the Stapes, the cells on the Basilar membrane rock back and forth like tourists on a raft.
BUT...because their hairs are embedded in the fly paper (Tectoral Membrane) the hair cells receive a wrenching with each wave movement.
Because of the structure of the hair cells and the composition of the fluid around them, each wrenching generates an electrical potential in the hair-cell.