A brand is a combination of things such as the name, logo, design, packaging, ethos and so on of a business; the logo is clearly just one element of a brand.
With that in mind, designing the logo is to design the mark or symbol that represents the overall brand as a whole, which can be clearly displayed on communications, products and so on. Something distinctive and recognisable to immediately convey the brand behind the good and, therefore, let the user know what to expect from the offering.
A brand identity can be further developed with uniqueness ensured via extra values (perhaps functional or emotional) that combine in a unique way to act as some sort of quality certification or affect perceptions.
On a larger scale, a corporate brand identity will encompass aspects such as how the organization is on a day-to-day basis, their communications, stakeholder perceptions, the ideal identity/best position to take in a market and where the organization would like to go. All of this is considered when developing the brand identity, so it will be at the forefront of minds when doing things that may have a bearing.
The logo represents this ideal.