In the 18th century this was a dish of fried meat and cabbage. Nowadays it is more often fried potatoes and other vegetables.
The dish as we currently know it is usually made from cold vegetables that have been left over from a previous meal, often the Sunday roast. By we I mean predominantly the inhabitants of the United Kingdom; there are few references to the term in American literature or media and the few there are point back to the U. K. origin. The dish didn't spread to the countries of the British Empire either - possibly because they had unsuitable climates for roast dinners or, more likely, they just didn't like it. It is somewhat less popular in the U. K. than before, which isn't surprising as the Sunday roast is less common too. Those that do bother to cook might be horrified to know that 'bubble and squeak' is now available in packaged, microwaveable form.
The first reference to the meal is from a rather surprising source - Thomas Bridges' 'A burlesque translation of Homer', 1770:
"We therefore cooked him up a dish Of lean bull-beef, with cabbage fry'd, ... Bubble, they call this dish, and squeak."
The Homer in that work would be more at home in the Simpsons as in the Iliad, so perhaps it isn't all that surprising. Francis Grose was a collaborator in that work. He goes on to give a definition of 'bubble and squeak' in his 'Dictionary of the Vulgar Tongue', 1785, which indicated how the dish got its name:
"Bubble and Squeak, beef and cabbage fried together. It is so called from its bubbling up and squeaking whilst over the fire."
By 1951, and possibly earlier, bubble and squeak lost meat as an ingredient. This may have been due to the rationing in force in the U. K. during WWII, when meat was scarce. This was committed to print in the 1951 edition of the food bible of the day, the Good Housekeeping - Home Encyclopedia:
"In the modern version of bubble and squeak the meat is usually omitted."
In a throwback to the Greek myth link in first citation we have the current rhyming slang use of the term - meaning Greek. This is by no means common but was recorded in 1968 by Leila Berg in her book Risinghill: death of a comprehensive school:
"'Why do they call Greek children Bubbles?' said Mr. Colinides to me ... Later it dawned on me that it was short for bubble-and-squeak'; rhyming slang.