Some applications that perform background processing modify the message loop in WinMain to see if there are more messages to process (by using PeekMessage). If there are no messages, the application can perform one or more steps of some background process while waiting for more messages.
OLE requires a server application to enter a separate message loop when certain operations require it to wait until an object, a document, or the server is released. (The message loop is necessary to process DDE messages between the OLE DLLs while synchronizing a sequence of calls in the server.) Like any other message loop, there may be idle time during which your server application can perform some background task. By isolating the code needed to perform a step of this background task, it can be called from any message loop anywhere in the application with the same results.