For instance when you take a portrait of a person you want the background to be dull, soft, and out of focus. You don't want the person looking at the picture to be wondering what is that shinny thing or what is that dog doing in the background. You want to keep your backgrounds as clean as possible.
Composition is done by moving the camera around to different points of view to balance objects with in the frame. This can only be done before the picture is taken. You can still frame your picture in photoshop later by cropping. But, in order to properly compose your picture you will have to move your camera in relation to the objects you are photographing.
Here is an example of how moving the camera slightly can make a huge difference. I wanted to get a picture of this gas station and its sign in Disney. In the first picture, I got the entire sign and only a small part of the building in the frame. You can read the sign clearly and the roof lines lead the eye to it. It's also the brightest part of the picture so naturally that's what the eye is drawn too.
However I don't like how I cut off the words at the bottom. It makes me wonder what they say and why they are cut off. And, I don't like that I cut off the point the roof makes when it comes together. That is just a personal thing.
This second image is of the same spot just framed a little bit different. I cut some of the sign off at the top to show more of the building. To me this makes a more interesting picture that is balanced as well. Again, the sign is the brightest part of the picture on the right side of the frame but is balanced by the blue sky on the left side of the frame. They are divided almost equally by the top of the building. To me the second picture has a better feel to it.
Here is another example that changes the composition and framing to create a more engaging photo. This first photo stinks! The position of the boat in this picture is terrible. It leads the eyes to the right side of the picture and off the page. So instead of looking at the pond and thinking oh that's nice or something like that, it makes you wonder what is to the right of the boat that you can't see.
For the second shot I took a few steps to the right and a couple forward to recompose the shot. Now the boat is in the lower left corner and the lines of the boat push your eyes towards the water. And, you can even see where the grass is separated for access. It almost feels like you are there ready to slide the boat into the still water.
Also I didn't try to get the entire boat into the picture. Sometimes it is ok to leave parts of things out of the frame. It goes back to the idea of "part of the whole." If we see part of an object our minds can imagine what the rest of it looks like. Especially with common shapes like the circular sign of the gas station. You can see part of the sign and your brain fills in the bit missing at the top. The same way your brain knows that there is a front that belongs to the back of this boat.