The UI is easier to understand at first because it is closer to the commonly used web design term,
i.e. it roughly covers graphic work, while the UX designer measures, tests, analyzes, and works with data.
If it’s not clear yet, then it may be easier, if you imagine the human body as a website.
The skeleton is the bones, that is, the programming work that gives the framework of the whole thing.
The various organs represent the UX, that is, measurements and optimizations to maintain vital functions.
The UI is the outer surface, the look, which is what you can see from the outside of the body.