What size subpanel and wire do I need for a swimming pool?
#4 copper is not legal for 100A.  You would need #3 for that.  Some people go around saying #4Cu/#2Al are good enough for 100A; there's a reason they think that, but they're wrong.
Most electricians doing this work for themselves would actually do one of two things.

For the full 100A, use #1 aluminum.  You may have heard negative things about aluminum (you're not getting the whole story)... but aluminum feeder of this large size is perfectly fine and there has never been a problem with it.  Besides, the panel lugs are aluminum lol, as are the buses on most panels.

Re-examine the requirement for 100A.  Quite often people pick it &quot;just because it's a nice round number&quot; without having actually done any load analysis.  If 90A is acceptable, #2 aluminum is a pricing and availability &quot;sweet spot&quot; and several types of cable are available in that size which aren't in #1.


As far as panel spaces, the worst mistake you can make is going with too small a panel.  Feeder (especially 80+ amp feeder) can power a whole lot more stuff than you think it can.  Even a 12-space panel will run out of spaces before it runs out of power.  So I would advise something more like a 24-space, even a 30 would not be excessive.  Breaker spaces are laughably cheap compared to the cost of having to change out a panel because the originally-chosen one was too small.
There's no worry if the bus rating of the panel exceeds the ampacity of the feeder.  Bus ratings are like tire speed ratings; you don't have to drive 130 mph :)   If the panel has a main breaker, it's also fine if the subpanel's main is larger than the supply breaker.  You can never predict which one will trip first anyway.
Spend the money on breaker spaces, not copper wire.