The CoreAlert class collects and returns alerts triggered from the various modules. In addition to the standard alerts, which persist only until the end of the request, there are also sticky alerts which persist in the session until they've been retrieved by the getAlerts() method. These are also known as flash messages.
The alert class is a singleton meaning there can only be one instance of it at a time.
//trigger a standard alert
CoreAlert::alert('This is an alert');
//trigger a sticky alert
CoreAlert::alert('This is a sticky alert', true);
//retrieve the alerts
$arrAlerts = CoreAlert::getAlerts();