Modals are more powerful than JS dialogs as they are very customizable. You can style modals in any way you want, just like any HTML element. There are many ways of creating modals and triggering modals. A major reason to use modals is that it isn't blocking like dialogs; dialogs prevent all JS execution and page loading. Modals are a must in the web application world, with giving information, warning users and asking for data being the main usages.
Ways to create modals:
Note: Modals aren't actually a specification, API or standard, they are just something useful you can create using plain HTML, CSS and JS easily (no libraries or plugins needed)