The difference between pails and buckets has to do with two things: function and perception. Although dictionaries provide similar definitions, variations exist in the minds of people, based on on location, lifestyle and occupation. For example, a maintenance worker who uses a mop and bucket to wash large areas in a commercial building likely pictures a bucket as a large, rectangular container. A smaller, cylindrical one might not suffice in that situation, particularly when resting the mop.
The differences between pails and buckets sometimes boils down to semantics and how people's perceptions have influenced usage of these words over time. For example, the word "bucket" connotes size. A "bucket of fun" indicates a high level of enjoyment as in a party or roller coaster ride. On the other hand, a "pail of fun" would not indicate the same thing. Bucket seats in a car are large enough for humans to occupy comfortably. Imagine, however, a car dealership advertising a car with pail seats.
Merriam-Webster's definition of "bucket" traces its origin back to the High German word meaning "belly." As for "pail," the Oxford Dictionary gives an Old English origin for "paegel" meaning "gill, small measure" and Old French "paelle" meaning "pan, liquid measure, brazier." Thus, there is evidence that size plays a part in how the words came to be used.
Garbage pails are used in private homes, while garbage buckets are used in an industrial environment. A bucket of ice cream holds several gallons of ice cream. On the beach, a child plays in the sand with a pail, not a bucket. During a fire, people have been known to line up and pass buckets of water down a line in an effort to control the blaze. However, to say they were passing pails would not be incorrect. No rules exist on usage for these two words. They can be used interchangeably.
Buckets come in a variety of shapes. Some are oblong, some square. Some have handles. Others do not. Pails have handles and tend to have a wider top than bottom. "Kick the bucket" endures as a metaphor that means to die. From that, the term "bucket list" came to be, which means a list of things to do before dying. These expressions would not seem the same if the word "pail" was used in place of "bucket."