On the defragging subject, please search these forums on the topic. The question has been asked many times before. Short answer: you don't need to.
As for how Linux handles file allocation, that depends on what filesystem you're using. Check out the Filesystems HOWTO
for descriptions of some of them.