When the squirrel hangs off the side of the feeder or the raccoon knocks the feeder to the ground, then you learn quickly that hanging the bird feeder in the right location matters.
My bird feeder hangs from an S-hook from a metal pole that my husband installed in the middle of our yard. It is out in the open with no tree branches around it. This is a good location because animals other than birds cannot get to it.
My neighbor has his bird feeder under the overhang of his garage, the seed never gets wet but every now and then a bird will fly into the garage wall and the squirrel get onto the roof of the garage and work their way down to the bird feeder. The seed falls to the ground and makes an awful mess. Hanging your bird feeder anywhere where the squirrels or raccoons can get to it is not a good location.
Other Tips
Never hang your bird feeder in a location that is close to a window as birds may fly into the window. Best to have the feeder in a location away from your home or garage. Your pole bird feeder should be 8 feet away from buildings, windows, privacy fences, tree branches, and walls.
Prevent squirrels from climbing the feeder pole with a baffle, it is a plastic dome that looks like an umbrella. Wrap it around the pole just below your feeder and this will put a stop to the squirrels from getting to your bird's food. There is also a product called Twirl a Squirrel, it runs on batteries and is a deterrent.
This video will show you how the Audobon baffle works.
Helpful to buy feeders that are made to prevent squirrels from getting the seed. Know that if squirrels are at your feeders then the birds will leave your yard.