They do this by awakening the associations and experiences you previously had with the brand, or have seen through advertising, when you come into contact with the brand at key stages. For example, when deciding what product to purchase out of a selection of similar items.
What is a brand? A brand is a symbol. Symbols are designs which represent something else, and a brand is meant to package all of the associations, experiences and characteristics into an abstract construct. This construct can be evoked using consistent imagery, sounds, phrases and logos with which people come into contact. Brands are very important as they help you win customers and they also help you to keep them.
Branding carries many rules. Color, Emotion, Character, Consistency, logo, reusing code, value proposition, tone of voice, uniqueness, to name a few. Add the 10 heuristic rules, then ask yourself why would someone come to my website? And address the answer to that. Mix all this into the equation, add a little SEO and you have a very successful milk shake.
I have over twenty years of experience doing just all this. Graphically to programming the ditches of php. Why is php important? It is the code that wordpress type of sites are made of, but what's more it can be a tool to do a world of things.