There are three major rail types Picatinny, KeyMod and MLOK.
Picatinny are MIL spec MIL-STD-1913 and on are on many military firearms, so I dont think they will be going any place for a very long time. There are also a very large number of accessories using this standard that also will not change any time soon. There are a couple downsides to the Picatinny rail; first is they can get heavy add unnecessary weight to your rifle and bulk it up in a bad way, especially when placed on the fore end of your rifle. They also have sharp edges that can get snagged on or damage other gear as well as un-gloved hands.
The KeyMod system gets its name from the shape of the slots, which look like old-fashioned keyholes. You put the lug through the big circular opening and then slide the attachment forward, tightening the Allan wrench in the narrow part of the slot until your attachment is securely fastened. It also has an auto aligning feature when you tighten things down. The design is completely open source, so anyone who’s interested in manufacturing products using the KeyMod system can do so without having to pay royalties. On the down side KeyMod did not do too good in the USSOCOM testing referenced below. Specifically the stress testing, this might sway me and others to look closer at our next rail, M-LOK. Especially if you are not heavily invested in one or the other.
The M-LOK system by Magpul uses slots in place of the keyholes. The attachment lugs on M-Lok accessories are t-shaped and bi-directional so they can be placed at the front or rear of the slots. While M-LOK is free licensed, it is not open source, and thus manufacturers must acquire a license from Magpul before making products using the M-LOK standard. Magpul claims this gives them more control in assuring that all M-LOK products are made to specifications ensuring compatibility. Program participation is open to any interested manufacturer. This might not matter with Magpul’s dominance in the accessories market.
I dont think Picatinny will go anyplace soon, especially for mounting scopes. It has already adapted to smaller sections that can be mounted on either KeyMod or M-LOK. M-LOK vs. KeyMod is where the real fight will be, and with the Magpul monster leading the charge for M-LOK we soon might see the end of KeyMod.