ELI5:How do rotary engines operate without damaging their housing?

I saw an animation of a rotary engine and I more or less understand how it works, but I noticed the tips of the rotors are basically dragging on the walls at all times. How does the engine operate without breaking the walls? Is there some kind of oil or lubrication? And wouldn't that cause the engine to not seal properly?