In Magento 2 what is the difference between a component and a widget? For example there is a modal component and a modal widget, they both appear to do the same thing.
Component
The Modal UI component implements a secondary window that opens on top of the main window. It uses the modal widget.
Widget
The Magento modal widget implements a secondary window that opens on top of the main window.
The widget can be initialised with a few lines of JS, where as the component requires many lines of XML and still uses the widget. So why would anyone use the XML method?