Some applications act with the privilege of the user running them. This is usually as it should be. However, some applications such as services (on Windows) or daemons (on *nix systems) may have higher or different privilege levels. Some applications may need to temporarily assume a higher privilege level, then "drop privileges" to that of an ordinary user. Others may interact with a high-privilege level service or part of the OS or kernel.
In the case of an application while it has a higher privilege level, a bug or other vulnerability in the application code may allow a user to act as the application and use its higher privileges to access information that is restricted normally to that user. Often application or system crashes have been used in this way. Buffer overruns, for example, can allow code to be injected by a hacker and this custom code then executes with the higher privileges and accomplishes tasks the user otherwise could not.
In these cases the vulnerability is often discovered by hackers and a proof of concept exploit is created and shown to the developer(s). Hopefully then a patch will be forthcoming to remove the vulnerability.