Many people often confuse the two.
What you are looking at below is not a coffin. It is a casket.
Coffins: Have 6 sides. They are designed to taper off at the bottom to accommodate the feet.
Originally they were used because they were seen as more efficient uses of wood.
Caskets became popular over the past 200 years because they are seen as being slightly less morbid —the 4-sided shape being less reminiscent of a dead body.
Fun stuff, right?