Oil and water may not mix, but with the right techniques and ingredients, seemingly incompatible things can come together to create magical mixtures like hollandaise and mayonnaise. Emulsification in cooking involves breaking down one of the ingredients into tiny droplets, and then dispersing and suspending them in another liquid to form a homogenous mixture, usually by whisking vigorously or by using an immersion blender, and often with the help of an emulsifier like egg yolks or mustard.
To create an emulsion, start with the aqueous or watery ingredient, then add in the fat (oil or butter) little by little, while whisking vigorously. The order, ratio and temperature of the ingredients matter, so always follow the recipe for best results.