EM and gravitational waves are seen as analogous because as I wrote, they are produced by acceleration of charges and masses, respectively. The physics behind them is very different (described by Maxwell’s equations for EM and Einstein field equations for GW), but all systems that have waves in them (including sound in the air, waves on the surface of water etc.) can be approximated as linear for small perturbations, which means that they satisfy the wave equation at that regime.
EM and gravitational waves are seen as analogous because as I wrote, they are produced by acceleration of charges and masses, respectively. The physics behind them is very different (described by Maxwell’s equations for EM and Einstein field equations for GW), but all systems that have waves in them (including sound in the air, waves on the surface of water etc.) can be approximated as linear for small perturbations, which means that they satisfy the wave equation at that regime.