The forces that produce beach foam