Autoaim is a feature of the engine that assists the aim of the player. Autoaim can be vertical or horizontal. Horizontal autoaim allows to compensate for the lack of precision in keyboard-only movements, which were still considered the norm at the time Doom was developed. With the keyboard+mouse configuration generally used nowadays, it is less needed, though still available. The early alpha and beta versions of Doom did not feature horizontal autoaim.
Vertical autoaim, however, was absolutely needed because vanilla Doom features varying elevations (making it a "2.5D" game) but not free look, making it impossible to manually aim at enemies that are above or below you. ZDoom, however, features free look and mouse look, rendering vertical autoaim optional as well. For this reason, autoaim settings are a matter of player preference and server settings.
The amount of autoaim can be adjusted from the player setup menu. Setting it to "always" gives up to 35° of autoaim, "very high" gives 3°, "high" 2°, "medium" 1°, "low" 0.5°, "very low" 0.25°, and "off" 0°. The behavior of autoaim can be changed from the gameplay options menu with the "Smart autoaim" option. If it is off, autoaim will always target the nearest SHOOTABLE thing. If it is on, it will try to avoid shooting at allies and non-monster things. Setting it to "never friends" will prevent it altogether from aiming at friends, and setting it to "only monsters" will prevent it from aiming at anything else than a hostile monster. It is also possible to disable autoaim entirely from the gameplay options menu, with the "allow autoaim" setting set to "no".
In addition, autoaim can be disabled on a per-weapon basis with the WEAPON.NOAUTOAIM flag.