They're designed for different use cases.
The D810 and kin are designed for wedding, event, and landscape photographers who need maximum resolution; flagship models like the D5 are designed for sports photographers and photojournalists who need maximum speed and low-light image quality. This is reflected in the pixel counts: the D810 has 36 megapixels while the D5 has 20 megapixels.
Continuous shooting on the D810 is a mere 5 fps at full resolution, whereas the D5 can fire at 12 fps (and even 14 fps with the mirror locked up and focus fixed). Higher frame rates means more chances to get precisely the shot you need when the "decisive moment" happens. Buffers are also much deeper, allowing high speeds to be sustained for longer periods of time.
To facilitate high performance, the D5 has an extremely fast image processor and takes faster memory card formats (a choice of CF or XQD is available). Because every second counts when delivering images for publication, the D5 (and other recent flagships, like the Canon EOS-1D X) have a built-in Ethernet port for immediate upload of images.
Sports photographers and photojournalists also tend to work in harsher conditions and need a camera that can keep up. Hence, while the D810 does have a solid build, it doesn't quite match the D5 in overall durability or weather resistance. The shutter rating is also higher on the D5 at 400,000 shots, as opposed to 200,000 shots on the D810; this is necessary due to the extremely heavy use that sports photographers subject their cameras to.
Flagship models have integrated vertical grips to accommodate larger batteries and extra electronics as well as provide space for an extra LCD below the main display. See: Why do the cameras Canon 1Dx, Nikon D4, Nikon D5 have a different form factor than other DSLRs?
Other factors, like autofocus, are less notably different between the flagships and lesser full-frame cameras. Hence, a D5 (or other professional flagship DSLR) is not necessarily better for your use case. If you need high resolution, don't routinely shoot sports or other fast action, and aren't under pressure to deliver images in real time or within minutes after an event, you would probably be better served by a D810.