Although the Mongol invasions at the end of the 13th century undoubtedly had an enormous effect on the Kamakura bakufu, early Japanese history is more easily explained in terms of internal processes. This can be made apparent by looking at the Yamato, Nara, and Heian eras; specifically at Japan's relationship with and influence from the continent over this period.
During the Yamato era, from about 300-645 AD, the society in Japan began to shift from tribal structures to a more unified, nation-like body. As the cheiftains of the ancestral clan of the imperial Sun Line accumulated power and gained control over more area, the tribal, family structure grew in scale. Extension of influence continued, and by the beginning of the fifth century Yamato was helping their allies, the Paekche, in Korea fight against enemies. The Yamato debatably held control of the Korean state of Kaya at this time, and at least had much contact with them. This contact with the mainland had been brought about by the development and expansion of the Japanese state, not the encroachment of outside forces, and therefore was a result of internal processes.
In the middle of the sixth century, the Korean state of Silla, with the backing of China, defeated its neighbors, unifying the Korean penninsula. The Japanese were largely unable to help their allies, due to a rebellion which broke out in northern Kyushu, forcing them to deal with internal problems. Although Japan lost its allies in Korea, contact still existed, and continental pressures continued. During the Yamato era, many foreigners migrated to Japan, bringing various talents as well as Chinese culture with them. Varied changes, in areas such as contruction and pottery, deeply affected the government and the lifestyles of the elite. One addition to elite life which would eventually be passed on to the common people was Buddhism, transmitted to Japan in the mid-fifth century. Although it originated in foreign lands, even Buddhism's success in Japan is easily perceived in terms of internal processes. The Soga family, devout Buddhists, went to war with varoius influential Shintoist families, eventually winning power for themselves and their faith by defeating other families in battle.
Throughout the Yamato era, the influence of the central families continued to grow, but power gradually dispersed from the Sun Line to other, more dynamic families. As government developed, administrative structures and systems were borrowed from China, the only known model. The supposed culmunation of this was the "Taika reforms," which would return power to the emporer and the Sun Line. According to the Nihon Shiki, this edict was issued in 622, made all land public, and created a system of provincial and district divisions with local governments responsible for collecting the taxes for the emporer. However, the validity of the Nihon Shiki is questionable, and even if this edict did exist, it was more likely only an ideal which the government was struggling to implement. In the mid-seventh century, Yamato sent a fleet to Korea to help against the attacking Chinese, but the Chinese proved too strong, and the Japanese fleet was completely destroyed. The proposals listed in the Taika reforms were most locally implemented following this defeat. In fear of retaliation from the continent, the opposing families likely accepted the Taika reforms in order to unify under the Emporer against the common threat. The resistance to and eventual acceptance of the reforms display another internal process in early Japanese history.
In 702, the Taiho code of laws, expanding on the Taika reforms, further incorporated Chinese government methods. One result was, in 710, the construction of the planned city of Nara, modeled on Chinese capitols, to where the capitol was moved. The period in which this was used as the capitol is termed the Nara era, and the city was a very cosmopolitan, international city. An example of this can be seen in the unveiling of the daibutsu in Nara in 752, to which representatives from many foreign countries traveled to witness. Chinese culture, architecture, writing, religion, and civil engineering which had begun to be adopted in the Yamato era was more thoroughly put into affect durying the Nara era.
Just as had happened during the Yamato era, the Nara-period Emporers gradually lost hold of power. At first in small amounts, but gradually more and more, individuals began to accumulate private land, and tax and legal exemption were extended to strengthening families, giving them realms of influence in rural areas out of reach of the emporer. However, as power broke down from a neat pyramid-structure to a more level structure in which many different families had comparitively equal authority, the aristrocracy remained affluent, and culturally and intellectually Japan continued to develop. In 794 the court was moved to a new capital named Heian in order to flee the influence of the Nara temples. The Heian era was, in regards to this cutural development as well as in the regress to family-oriented government, a continuation of the Nara era. The decline in central authority reached a landmark in 858, when the Fujiwara family successfully pickpocketed imperial power by marrying itself into the imperial family; Fujiwara influence would continue until the beginning of the Kamakura era.
Initial contact with the continent was a result of the stability of the Japanese state. The spread of Chinese governmental structures and Buddhism, both seemingly signs of external processes affecting Japan, were initially blockaded internally and were only accepted after resistance had been subdued internally. Finally, the change of powerful families to aristocratic elite in the Nara and Heian periods allowed Chinese culture to influence Japan more and more deeply.