Yoshiko Amino, a Japanese historian, wrote about the Standard Japanese. He researched historical documents in Kagoshima prefecture, furthest southern part of Japan. When he was waiting for a bus at a bus stop in some rural village, he heard old women were talking with each other in Kagoshima dialect, but he couldn't understand what they said at all. He wondered why he could read historical documents written in Kagoshima in old days, but he couldn't understand Kagoshima dialect nowadays.
My wife said that she couldn't understand what her ground mother, who had lived in Aomori prefecture, furthest northern part of Japan, said. I also have the same experiences in Aomori prefecture and Kagoshima prefecture.
Of course I can understand what young people say even in their dialect and most of them can speak in standard speaking Japanese now.
In the pre-modern age there wasn't the standard Japanese, at least Japanese government didn't try to make up the standard Japanese. As Yoshihiko Amino said, there was the de facto standard writing Japanese. Since the official documents circulated throughout Japan, every intellectual person had to learn reading and writing in the de facto writing Japanese.
On the other hand speaking Japanese was made up in each community, so they spoke their own dialects in their communities. But in pre-modern Japan there was little chance to talk with people outside of their own communities, so speaking Japanese had wide varieties.
In the Meiji era Japanese government tried to unite Japanese nation and the Japanese language. It's common to unite the national language in the time of formation of the nation state in many countries.
In France many different languages used to be spoken. For example Languedoc, southern part of France, means the land of d'Oc language. In the age of absolutism French government made up and disseminated the standard French language in order to unite the French nation.
On the other hand in the English language there is no standard speaking language. (At least I think so. Is it right?) Queen's English is one of the models of speaking English, but every British people don't speak Queen's English. I can't catch Alex Ferguson's speaking well. Of course American English, Australian English, Canadian English, Indian English and the other "Englishes" (including my Japanese English) are different from each other, and no one can define which the standard English is.
In Okinawa islands, which was a semi-independent kingdom in pre-modern age, people had spoken very different dialect from one in mainland Japan and it was almost impossible to communicate with mainland Japanese people by speaking Okinawa dialect. In the Meiji era the Japanese government amalgamated Okinawa into Japan and tried to assimilate Okinawa people into Japanese nation. So they forced Okinawa people to learn mainland Japanese language in school education, same as in colonial Korea and Taiwan before World War II.
But before the spread of radio, most Japanese people had little chance to hear the standard speaking Japanese in fact, so they mainly spoke their own dialects. Some intellectual people got high education in Tokyo and learned the standard speaking Japanese.
After the spread of radio and TV, most Japanese became to be able to hear the standard speaking Japanese, which announcers spoke, and they could learn the standard speaking Japanese. Now that most Japanese can speak the standard speaking Japanese and their own dialects, in other words they are bilingual.
Formerly people thought of speaking a dialect as shameful, but now dialects have a much better image than they used to be. I feel that a girl that speaks her dialect is cute, now.