Military versus commercial. The P-8 is a derivative of the commercial 737. The P-1 is a military aircraft. Like most countries, the Japanese government readily subsidizes domestic companies like IHI for aerospace/defense related projects like dedicated engines for the P-1.
Consider the Honda business jet project. Honda and IHI tried to develop their own clean-sheet engine design. But eventually partnered with GE for the production and certification work.