TL;DR Install GFCI receptacles
Grounding, AFCI and GFCI perform three different, but complementary, functions.
Grounding takes care of a few different things, including providing a path for static electricity to get back to "ground" and enabling certain types of short circuits to complete in a way that will trip a circuit breaker. Grounding has been part of the basic design of residential wiring for a long time, but it is not critical when everything else works correctly. For grounding to work properly, it has to be installed in a particular way in the main panel and connected all the way to each device or receptacle.
AFCI protects against Arc Faults, which primarily means for protection. This includes certain types of problems that can be caused by loose wires, nails through wires, damaged insulation and other things. It is most effective when installed in (or near) the main panel so that it can protect against both wire damage and device problems.
GFCI protects against Ground Faults, which primarily means protection against serious injury and death. This is an imbalance between hot and neutral (or hot & hot on a 240V circuit). It is called "ground", but it actually does not require a ground connection to do its job. The key is that any electricity from hot that doesn't make its way to neutral must be going to someplace else. That someplace else is generically "ground" but may be: ground wire (ideal, safe), a person (not safe), a pet (not safe), exposed parts of equipment (not safe if they can be touched by a person), etc. The really great thing is that if the electricity would be going over a ground wire, but that ground wire doesn't exist, then it will go somewhere, and the GFCI will trip to stop that electricity.
The end result is that, in addition to its primary duty of protection against serious injury and death, a GFCI will effectively provide the protection that a ground wire would supply, even if the ground wire is not connected. So it is the cheap & easy way to convert from 2-wire to 3-wire receptacles. The way you do this is to install GFCI at the first receptacle in each chain, and any additional 2-wire receptacles can be replaced with 3-wire receptacles and marked as "GFCI protected, no ground". And you are safe.
In fact, you can install the GFCI protection in the breaker panel instead. That can be even easier to do, and less confusing (no need to figure out LINE vs. LOAD). Then you can replace all the 2-wire receptacles with 3-wire receptacles (and label them...). The catch is that generally speaking GFCI receptacles cost less than GFCI breakers and, depending on the type of panel and existing breakers, this may not be an option. GFCI receptacles are always an option.