A ball valve is a type of valve used to control the flow of fluids. It operates by rotating a spherical ball inside the valve body. When the hole in the ball aligns with the flow direction, the valve is open, allowing fluid to pass through. Rotating the ball to block the hole closes the valve, stopping the flow.