>>54655953This is the damage calculation in the modern games.
While there's a lot here, you can ultimately narrow it down quite easily as most of it is static numbers used for scaling and rounding, or basic multipliers. The only part you need to hone in on to understand the interaction between Attack and Defense is the first section.
What the game essentially takes is the mons level (and scales and rounds it to a number from 2 to 23 roughly), then multiples that by the base power of the move. Following that, the users Attacking stat is divided by the opponents defending stat.