It looks like lots of people are finding this via Google and the accepted answer isn't particularly precise, so I'll post my own answer.
Flashing caps lock and scroll lock lights signal a kernel panic. This means that the Linux kernel has experienced an unrecoverable error and cannot continue, a condition equivalent to a Stop error ("BSOD" or "blue screen") on Windows. However, because the Linux kernel is only able to directly output text on a console, it cannot signal a panic on the screen when the X server is running. As such, it blinks the Caps Lock and Scroll Lock lights on the keyboard continuously to indicate that the system has crashed.
A kernel panic can occur for a wide variety of reasons, ranging from hardware problems to faulty drivers to filesystem corruption. Your system log may contain more information; however, systemd-based distributions may not be able to write the information to disk because buffers are not synced on a panic (to prevent data corruption in the event the panic is caused by a filesystem bug). To diagnose a panic, a feature called kdump is available which uses a second Linux kernel running in a reserved region of memory to save a core dump of the failed kernel for analysis.