Offsides means someone (either offense or defense) was on the wrong side of the line of scrimmage when the ball was snapped. If it is the defense, play continues (meaning a free play for the offense).
Neutral zone infraction means that the defense started to soon which caused an offensive player to react. Play is stopped immediately.
The big difference between offsides and neutral zone infraction is whether play is stopped immediately.
Encroachment means that the defensive player actually made contact with the offensive player or has a clear shot at the quarterback. Encroachment also stops play immediately.