Mixing oxygen and hydrogen at ambient temperature doesn't do anything exciting -- it just yields a mix of the two gases.
In the presence of sufficient heat, mixed oxygen and hydrogen will burn, combining into (mostly) water vapor and releasing still more heat, which maintains the reaction. This is technically called combustion and is much the same as what happens when you burn any flammable substance with oxygen.
If hydrogen and oxygen combust together in an enclosed chamber with no way to release the pressure, the increasing heat and pressure will eventually burst the chamber; that would be an explosion, but that's not what happens in a properly operating rocket engine.
If there's an opening at one end of the combustion chamber, then hot expanding gases will escape and produce some thrust. If the opening is a convergent-divergent nozzle of appropriate design, the gases go out at supersonic speeds and produce lots of thrust; that's a good rocket engine.
Because cold hydrogen and oxygen don't combust by themselves, a hydrogen-oxygen rocket engine needs some kind of igniter -- either an electrical spark system (like spark plugs in an automobile engine) or a chemical igniter of some kind; I believe spark igniters are more common for hydrogen engines.
Some rocket fuel/oxidizer combinations do ignite spontaneously without a source of heat; these are called hypergolic propellants.