You've probably seen ability checks like this throughout the game:
There are three separate factors at work here -- a Difficulty Class (DC), a number of static or semi-variable modifiers (like Guidance), and a 20-sided die to serve as the catalyst for random chance.
Functionally, this is very simple:
- Roll the d20
- add the modifiers
- compare to the DC
Attack Rolls work the exact same way, though rather than "Difficulty Class", use "Armor Class" (AC) instead. Regardless, this value can be viewed via the "Examine" menu. (Right-click an enemy on the PC version)
The modifiers are on the character making their attack. If you open a character's inventory, you will see an "Attack Bonus" that corresponds to their currently equipped weapon(s).
So if Shadowheart were to make a mace attack against Cyrel, we'd roll a d20, add 2, and compare that to Cyrel's AC. If that number is 10 or more, the attack hits, and damage is rolled.
Damage is calculated much the same way -- though instead of rolling a d20, you roll one or more different dice depending on the weapon itself. Shadowheart's mace, for instance, is a 1d6. Comparatively, a Githyanki greatsword, is 2d6
Spell attacks function identically (though make use of a different set of modifiers).
One final note -- rolling a 20 on the attack is a "Critical Hit". In such a case, you double the number of damage dice, whatever they are (2d6 in the case of Shadowheart's Mace, or 4d6 for Lae'zel's Greatsword).
And as a counterpoint to that, rolling a 1 on the attack is a "Critical Miss". Such an attempt will always result in a miss, even if the bonus would otherwise beat the AC.
While the actual calculations can get much more complicated as various buffs and abilities are added on, this is the core of the system, and hopefully helps shed light as to what's been implemented behind the screen (so to speak).