You are talking of Depth of Field which is affected by factors such as the camera you own, level of lighting/aperture, lens, and focal distance. Depending of your camera design only buying lens may not solve the whole problem.
The peasant look of soft-focusing the background while keeping sharp...