As the title says, Why does Minecraft: Java Edition need a server to play multiplayer Minecraft? while in Minecraft: Bedrock Edition you can easily join someone's world without a server. Can you join someone's world in Minecraft: Java Edition without opting for a server? Why Does Mojang not create server-free multiplayer?
When you connect to someone else's bedrock world, your console is connecting to their console. That console is a bedrock server. It also looks like Mojang is looking into Bedrock servers on PCs.
There are two "halves" of Minecraft, the program: The first half is keeping all the data about the world and everyone in it, and the second half is displaying that and taking input. Playing singleplayer the same computer (PC or console) is doing both parts.
Because console users generally don't expect to leave their console on, running a game-like background program, unavailable for playing a game, hosting but not "playing" is not available.
PCs can be expected to run game-like background programs. It is entirely possible to host a Minecraft server and connect to it from the same PC.
A commercial Minecraft server is a PC running the world part without the ui part, that someone is paying to run all the time.
You can join to a LAN hosted game on JE just fine - if you're on the same LAN. JE on PC doesn't have the same 'friends network' with a centralized service tracking who is on-line, who is hosting a networked game and who is that person friends with - with consoles it's not nearly as robust as you make it seem either, a Playstation player won't easily connect to a game hosted from an X-box or Switch - the connection is managed by servers provided by given console manufacturer and exclusive to that console, unless some manufacturers decided to provide a cross-play and created a connection between their services (Sony is notorious for refusing to do this.)
Instead, you use "out of band" communications (Discord, communicators, phone) to decide which server you and your friends will play on. Setting up a server is more work, but it can run 24/7, possibly on a powerful machine rented for that purpose and capable of running smoothly with a lot of players on-line, and very complex contraptions and builds - not burdened by having to perform all the client-side calculations, and possibly with better network connection - specifically uplink - sending a lot of data which is expected from a server, and which is often deeply throttled on 'home consumer' broadband typical for console users. Never mind the open nature of Java Edition, allowing for modding the server thoroughly, or even switching it out for a 3rd-party version with features absent in "vanilla".
In general, JE sacrificed the ease of setting things up for a much more robust and powerful "end effect" - quality, power and robustness of the server.