Max Raid battles are battles where you can find Dynamax and Gigantamax Pokemon in Sword and Shield. You can either do them by yourself with NPCs offline or connect to the Internet to fight together with others around the world in a co-op mode. This guide will help you understand how to join one of these battles with friends or randoms over WiFi. It helps with hosting one too.
Alternatively, it is possible to host your own Max Raid battles if you possess Wishing Pieces.
You can see what type(s) the giant Pokemon is and switch the Pokemon you will use in the battle while waiting for other players to join. If not enough players join, NPCs can fill the empty slots.
Some players may be weak and could possibly cost you the battle. Especially people who do not pick Pokemon with type advantages. NPCs aren’t that great at fighting these Pokemon either.