Como hacer pasteles means "how to make cakes." The phrase is used as a title for recipes and for videos containing instructions on how to make cakes.
An alternative phrase could be "cómo hornear un pastel," or "how to bake a cake." These phrases additionally are used for search engine optimization. A website that contains information about how to make cakes and wishes to reach a Spanish-speaking audience would include these phrases in its list of keywords used by search engines. The website is thus able to efficiently reach its intended viewer base, and Spanish-speakers are able to easily find information about making cakes.