Aside from being more flexible they are mostly the same game. The original excuse for bedrock was that Java was slow and a native game would render much better, it was also easier to put shaders in a a native codebase. But Java edition is pretty performant nowadays and computers also got much more stronger than the game became heavier
Java edition still horribly underperforms. It’s mostly single-threaded and even if they’ve rewritten the lighting engine a few times (those decade old black-block bugs disappeared), the Sodium family of mods show you how much it can be improved.
As far as I can remember the origins of Bedrock are the original console releases which couldn't ship a JVM. So a whole new codebase was developed, and ultimately it was more performant as it had to run on 7th gen consoles.