Primaries are only tangently related to complementary colors. Sure, it is commonly said that every RYB complementary pair is also a primary/secondary pair.
But complicating this is that primaries can be defined in many ways.
Any primary set expresses indivisibility. The psychological primaries set is: black, white, red, green, yellow, blue. To me this seems wonderfully commonsensical. No matter that in RYB space, black can be expressed as a mix of red, yellow and blue in equal proportion. For me, black is black. Full stop. However, these primaries have limited utility in design.
The RYB primaries started life exactly as utilitarian tools for painters. From this set, all other colors can be defined (so long as one had a warm/cool pair of each primary).