One of the reasons for this peace and prosperity was the cultural unity that prevailed during the period, and the most representative example of this was the Shinto Revival, which occurred in the 18th century.
Shinto is a kind of nativist, animist religion that focuses largely on the worship of nature and combines elements of Buddhism and Confucianism. It had existed in Japan for perhaps more than a thousand years before the Edo period, but had somewhat been associated with mainland Asia and in particular China. It was during the revival period in the 18th century that Japanese practitioners began to try to put a more nationalist spin on Shinto and shear some of the Chinese influences off of it. They wanted to make it more of a state religion (as it in fact later became during the Meiji Restoration).
Although the success of the Shinto Revival is debatable, this was a cultural practice that helped unite people during the Edo period. Because of the development of the economy and of transportation links, cultural influences—which proved highly unifying—were able to spread more quickly, and Shinto was no exception. The power of Shinto priests in some respects began to parallel those of the daimyos.