What is a beginner-friendly microcontroller and why?
The micro should have the peripherals you need.

For example if you need WiFi or whatever, that will narrow down your choices. ESP32 is a nice micro, btw, a bit power hungry, but cheap and powerful. Besides the WiFi, its most notable perk is the multichannel PWM with dithering which is great for LEDs.

Cheap development board or module so you can hack it and not care if you fry it, with lots of IO available on pin headers, and USB connectivity for programming.

No separate programmer should be necessary to get started. It is also quite useful if the board can double as a programmer and work with the micro itself if you use it on a PCB of your own design. All modern micros support in-circuit programming, so there is no need to use a socket, pull the micro, put it in a programmer, etc. For example, an arduino can act as an AVR programmer, STM32 Nucleo board can also act as a programmer by moving some jumpers on it so these can program a chip on your board. The manufacturers want to sell micros, so they want students to play with their cheap boards so when they graduate and get a job they will use their products in their designs.

Functioning build tools with fast compile-upload

For example I'm working on a STM32G0. It takes about one second to compile the application, flash it in the micro, and execute it. This is convenient. Some toolchains are much slower, which is a pain.

If there is an IDE, it should be usable.

For example, arduino IDE is garbage, but fortunately it can be replaced with a makefile and a text editor, so no problem. But arduino does not offer debugging, this requires a debug probe or other contortions. More modern micros offer debugging via the USB chip on the eval board. For example, with most ARM chips from ST or NXP, the IDE is Eclipse which sucks, but the debugger is really nice. Basically, hit &quot;Debug&quot; and one second later it is compiled and flashed and you can single step the code, set breakpoints, etc. This is really convenient. It feels like developing on a PC. The ST interface is quite fast so there is no noticeable lag. The NXP hardware I used a few years ago was a lot more temperamental and laggy while debugging, maybe they fixed it.

Lots of online documentation and tutorials

If you want to go bare metal, a proper datasheet helps. But if you want to use the libraries and code provided by the manufacturer, then it helps to use a micro that a lot of other people use, so you can find online examples. So, pick a popular micro, there is arduino of course, STM32, ESP32, etc.
The AVR micro on the arduino is pretty simple, but more modern ARM chips are quite complex with tons of peripherals. So documentation is really important, and also pin configuration. For example ESP32 gives you easy to use functions to assign pins to peripherals and decide what goes where. ST makes a GUI tool so you can click on stuff and assign functions to pins, then it generates the initialization code for you. In both cases reading the docs is not optional if you want to know what the peripheral actually does.
Arduino holds your hand a lot, which is nice, you can get stuff done fast. If you need to interface with a chip, say an I2C chip or a sensor, someone wrote a library for it, that saves time. Arduino is a bit like lego. You copypaste random stuff from the internet, and usually it works. The drawback is that the code quality of many of these libraries is pretty bad.
STM32 holds your hand a bit, but the learning curve is steeper, so you have to read the manual. Also the micro has lots more stuff. For example you can program it to fire a set of ADC channels on a timer, have DMA copy the results to RAM in a rolling buffer, and raise an interrupt when the buffer is half-full. That's a bit of setup. But the reason it's more complicated than on an AVR micro is mostly because the AVR micro can't do any of that.
ESP32 is somewhat in the middle.