.addEventListener & .ready

For the two statements below, how are they different? I have a native app with many forms and which uses jqWidgets extensively. Which of these statements should I be using, and when should I be using them?

$(document).ready(function () {…

document.addEventListener(“deviceready”, function(){…

My understanding is that ready is fired when jQuery (not jQuery Mobile) is complete.
https://www.w3schools.com/jquery/event_ready.asp

deviceready (or onDeviceReady) is fired once PhoneGap is done loading.
https://cordova.apache.org/docs/en/9.x/cordova/events/events.html#page-toc-source