It's because the whole "primarily locals" thing is a lie and a sad excuse used by WDW fans who grump about why WDW doesn't need the stuff Disneyland always gets like new rides, new shows, new night parades, holiday overlays, updates to Fantasmic or World of Color, better Christmas decorations, etc., etc.
There's a lot of "locals" who go to Disneyland, because Disneyland sits smack dab in the middle of one of the largest megacities in the Free World with 20 Million people living within a 90 minute freeway drive of Disneyland.
But there's also a lot of domestic and foreign tourists who go to Disneyland while they visit SoCal and/or stay in the 28,000 hotel rooms within the Anaheim Resort District bubble. In 2018, just over 50 Million tourists visited Orange County, and the foreign tourist slice of that pie rose by 3% that year. It's big business.
And Convention Center Guests, plus visitors and teams/staff for Angel Stadium, Honda Center, The American Sports Center that hosts multiple Olympic level events for volleyball and other sports, etc.
One of the pushes for Anaheim Hotel Rooms are more Business related than tourist related in the last few years. Of course, many folks that come for business opt to do a few tourist things.