Trying to explain this plot is almost as redundant as attempting to explain why anyone would take a Lamborghini to an ice-rink (it happens in this film on a way, way bigger scale, obviously), but here goes.
After attempting to steal a Russian submarine in order to gain control of its nukes and do whatever she pleases for the rest of her life while making sure all governments behave themselves (this woman is the hero we need), Cipher is thwarted by a combined effort.
It is revealed that Toretto was working with the Shaws (through their mother) to set up an alternate plan while he appeared to work for Cipher. With her distracted by the Toretto gang stopping her sub (by removing the targeting chip), the Shaws attack her plane, rescue the baby and save the day. On the ground, Toretto kills her right-hand man Rhodes and takes out the submarine using one of its own heat-seeking missiles.
Deckard Shaw clears up in the air, but Cipher escapes (to Greece),
Incidentally, there is no post-credits scene.