Privilege escalation occurs when an attacker exploits a bug, a design flaw or a misconfiguration in a software being executed with higher privileges to gain access to protected resources or gain code execution with elevated privileges.
Nonetheless, there are two types of privilege escalation:
Vertical privilege escalation: This is the actual privilege elevation, where an attacker with lower permissions can access functions or content reserved for higher privilege users. For example, an attacker can read the file /etc/shadow on a system thanks to a path traversal vulnerability in an application being executed as root.
Horizontal privilege escalation: The horizontal privilege escalation, pretty common in lateral movements techniques, occurs when an attacker takes over other accounts with almost the same privileges as the attacker. For example, an attacker can obtain an NTLM hash of one user on an AD environment to access a different computer.