2 H4 + H4EAD application 4-6 weeks apart

Im on H1B with expiration date of May’24. I am also planning to switch jobs in the next 4-6 weeks

What happens if Company A (current employer) files for H1B+H4+H4 EAD and 3 weeks later Company B (new employer) files for H1B + H4 + H4 EAD?
I understand H1B may get transferred (doing premium processing) but H4 + H4EAD will be under process (pending approval) - what will be the impact to the H4 + H4EAD petitions?
Can we withdraw Company A petition after Company B petition is approved?

Once the transfer petition is approved and you resign to join the new employer, you existing employer will withdraw your H1B petition. Once that is done, the H4 extension of status and EAD will be denied.