How do farms work in Minecraft?

How do farms work in Minecraft?

See also  Who made Rocket League 2d?