"Merging layers combines several selected Photoshop Creative Suite 5 layers into one layer. Flattening occurs when you reduce all Photoshop layers to one background layer. Layers can increase file size, thereby also tying up valuable processing resources. To keep down file size, you may choose to merge some layers or even flatten the entire image to one background layer."
Flattening takes ALL of the image layers and and merges them into a single background, which makes the file size much smaller. Merging allows you to choose which layers to flatten. So they are very closely related, but not exactly the same thing.