This message occurs when...
A) Your boot disk is low on storage and the macOS Kernel cannot create new swapfiles. For most people this is not the case.
B) You have a process (or a set of processes) that are asking for excessive amounts of virtual memory address space. The macOS kernel create page in memory page tables to manage all virtual address space. If a process or set of processes request too much virtual memory address space, eventually the macOS kernel is using so much RAM to page tables that it no longer as sufficient free RAM for applications to run.
Applications -> Utilities -> Activity Monitor -> Memory may tell you what processes are using a lot of memory.
But some applications like web browsers use a separate sub-process for each open tab. Any give sub-process may not be using a lot of memory, but if there are a lot of tabs open, they add up to a lot of memory and virtual address space being used.
Video editing and large file image processing can also be very virtual memory intensive. Especially if running several concurrently or having open multiple large format files concurrently.
There are also some poorly written apps that have memory leaks. The longer they run the more virtual memory they forget they have asked for, and it accumulates. Note, this can happen to a web page's JavaScript, but if that is the case the tab sub-process should show a lot of memory usage.