sex with less than 13 years old is forbidden by the law of Japan. sex with less than 18 years old is forbidden by the ordinance of all prefectures. There is a place which does not have this ordinance depending on an area.
The rule has not changed. It is less than 13 years old that the law of Japan has protected from sex. The rule of the all prefectures which protect less than 18 years old was added. I consider like the difference between United States Federal Law and a state law.
The following is my imagination. In Japan, the "Emperor family" has governed Japan from the time of a myth at the beginning of historical. The tradition and the ceremony which are transmitted more from ancient times occur. In old Japan, it was becoming one of adults at the age of about 13. It may be that the vestiges from the time remain. Since Japanese people are the conservative races which value history and tradition.