Amusement Park Lines

I’m curious about the math that goes on behind the staffing of rides at amusement parks. It appears that they know the minimum staffing and minimum cars they can run without making people mad enough that they won’t come back.