Background
The following is taken from Hungerford's Abstract algebra an Introduction and F Jarvis' Algebraic Number Theory
Exercise 1 Prove that an ideal $(p)$ in a PID (principal ideal domain) is maximal if and only if $p$ is irreducible.
Lemma Let $R$ be an integral domain, and let $p\in R$. if $(p)$ is maximal, then $p$ is irreducible.
Exercise 2 If $R$ is a principal ideal domain, show that the converse of the above lemma is also true.
Question
I often see an exercise showing that an ideal is mxiamal iff it is irreducible in a principal ideal domain in the form expressed in Exercise 1. I found in an algebraic number theory text, that the statement of Exercise 1, in one direction, it seems that in one direction of the statement, it holds true for a ring to be an integral domain, while in another direction, it need the stronger requirement to be a principal ideal domain. What I want to know is why there is this difference.
Thank you in advance