How does electric golf carts work?

an electric motor drives the cart, similar to an electric car or a gocart.