What makes the most difference in building to learn is the tiny steps you take to build. Printing hello world for the first time, changing it and seeing something else, using inputs for the first time to print hello, [variable], getting that image to animate across the screen. Each step becoming a great foundation for further curiosity, rather than turning your project into a black box.
In contrast, I've heard from a bunch of people who wanted to learn software development, but now don't see a point since AI can do it. Same with drawing. There's a large growing apathy towards learning skills I've noticed.
This is why most advocates for it don't do it from the perspective of learning. They do it from the perspective of building fast in the hands of those who already grasp the foundations.