Cream contains fat and water molecules. When ripened and sheared, the fat particles combine to form an emulsion with some of the water particles. This emulsion is called butter.
Cream is made up of fat particles suspended in water. When the cream is agitated, it is converted to an emulsion of water particles suspended in fat. The emulsion that occurs between the fat and water in cream causes butter to form.
Cream goes through two steps as it transforms to butter. First, the cream is ripened. In a commercial setting, cream is brought to the correct temperature in stages. At home, cream comes to room temperature. Ripening causes a membrane to form around the fat globules with a layer of crystallized fat particles behind the membrane.
Shaking the cream, a process known as shearing, breaks the membranes that hold the fat crystals. The fat crystals merge and form clumps. Further shearing causes more fat globules to join together and separate from the water and proteins left over after the fat has been removed. With continued shaking the fat globules form a single clump of butter. The aqueous portion that remains is buttermilk.