Shinto and Buddhism are two separate religions.Buddhism originated from India and passed through China and Korea,extremely spreading to Japan around 500AD.Shinto is the natural religion of Japan since ancient times,and deals with spirits and gods of the natural world.
Buddhism did not replace Shinto.Instead,both religion thrived and even blended.Buddhists built shrines and Shintoists enshrined Bodhissattvas.Ceremonies to celebrate birth and marriage often come from Shinto,the joyful religion.Funeral ceremonies are Buddhist,the religion that acknowledges suffering and pain.