Verified Answer :

Japan saw foreigners as a threat after Spain seized the Philippines.

they turned against them because they were fighting for power and they adopted Western firearms so they could firm them to leave.