What is the maximum number of black and white pieces which are relevant in a checkmate position (by White)? That is if any piece (black or white) was removed from the board, the checkmate would not be possible because that piece is relevant or has a role in such checkmate position because it may be: (1) checking the king (2) blocking a square where the checked king can move (3) attacking the unoccupied square where the checked king can move (4) preventing the king or other pieces to capture or block the checking piece. (Note that there shall be no idle or useless piece including the White king)
Addendum 5/27/2021-Using @Hauke's Reddmann's position as a plagiarised base, 20 pieces is indeed feasible!
[FEN "1B2R2B/1Nq1bK2/2p2n2/Q3k3/5n2/1N2bP2/1r5B/B3R3 w - - 0 1"]
I found another, far funnier, reason why a piece can't be removed; the position would otherwise be illegal!
Using this idea, I've managed 19 pieces. White's pieces can't be taken, with the White king unmoveable, or else the checkmate is null. Black's pieces prevent illegality and "guard" c4, minus the e6 block.
[FEN "8/2B1R3/1N1rnp2/1Qq1knR1/2pP1r2/2K1bPB1/4R3/8 w - - 0 1"]