Might their inclusion be something to do with (relative) closeness of consangunity to the monarch?
The children of the queen's cousins had the same closeness of consanguinity (5th degree) to HM as the children of David and Sarah do now (also 5th degree). However, they were never included as members of the royal family. And Mary's children (4th degree) were always excluded...
Keeping the queen's cousins who are royal highnesses makes a lot of sense even though they've moved from fourth to fifth degree when Charles became king - as they are royal highnesses and were once grandchildren of the monarch, unlike Margaret's grandchildren who are only great-grandchildren of a former monarch and never had a royal style or title.
UNDER KING CHARLES:
1st degree:
William*, Harry*
2nd degree:
Anne*, Andrew*, Edward*, George*, Charlotte*, Louis*, Archie, Lilibet
3rd degree:
Peter, Zara, Beatrice*, Eugenie*, Louise, James
4th degree:
Savannah, Isla, Mia, Lena, Lucas, Sienna, August, David, Sarah
5th degree:
Richard*, Edward*, Alexandra*, Michael*, Charles, Margarita, Samuel, Arthur
It will be interesting to see whether this is also the group he will invite for Trooping and the Christmas lunch.
Would we apply the same rules to the Queen, the royal family would have looked like:
UNDER QUEEN ELIZABETH:
1st degree:
Charles*, Anne*, Andrew*, Edward*
2nd degree:
William*, Harry*, Peter, Zara, Beatrice*, Eugenie*, Louise, James
3rd degree:
George*, Charlotte*, Louis*, Archie, Lilibet, Savannah, Isla, Mia, Lena, Lucas, Sienna, August, David, Sarah
4th degree:
Richard*, Edward*, Alexandra*, Michael*, Charles, Margarita, Samuel, Arthur
5th degree:
Alexandra, Davina, Rose, George, Helen, Nicholas, James, Marina, Frederick, Gabriella, David, James, Jeremy, Mark, Henry, Martin
Note that the queen would also invite the children of (some of) the 6th degree blood relatives to Trooping - although neither the 5th of the 6th degree blood relatives were on the list as members of the royal family - and those descending for princess Mary were never invited (or never showed up).