It's necessary to understand these in the context of Tolkien's lifetime of work, which I'll (briefly and incomplete) summarise (in rough order of writing) as:
- The Book of Lost Tales,
- The Children of Húrin poem,
- The Sketch of the Mythology,
- The Lay of Leithian,
- The Quenta Noldorinwa and associated works,
- The Hobbit,
- The Quenta Silmarillion and associated works,
- The Lord of the Rings,
- Subsequent revisions and essays relating to all of the above.
What was published as Unfinished Tales was extracts from these works, with little consideration of order of composition, but primarily from the last item listed. Some of it dates to the period after LotR was completed but before it was published, some of it was originally intended to be included in LotR, but much of it is much later.
It's completely incorrect (and shows a lack of knowledge of the material) to refer to History of Middle-earth as "notes and scraps"; it instead contains major finished works, some of which were earlier variants on what became better-known stories, but some of which are otherwise completely unknown.
Much of what is published in History of Middle-earth was actually intended (by the author) for publication; some of it was even submitted for publication (but rejected) - for example, almost all of the material in History of Middle-earth 5 (The Lost Road) was submitted for publication as a potential follow-up to The Hobbit.
This isn't "notes and scraps".
The material in Unfinished Tales is most closely related to that published in volumes 10, 11 and 12 of History of Middle-earth (and some of it is even derived from essays more fully published in those volumes; so we learn that the Druedain material in UT is actually an excerpt from Of Dwarves and Men, given in full in HoME 12) and so Unfinished Tales may be seen as the last volume of History of Middle-earth, despite the fact that it was published before any of them.
The intent of Unfinished Tales is to further expand on items more briefly mentioned elsewhere, and in particular to provide some answers to some of the most popular questions asked by readers of Lord of the Rings looking for more information. As Christopher Tolkien notes in his introduction:
Many of the pieces in this collection are elaborations of matters told more briefly, or at least referred to, elsewhere; and it must be said at once that much in the book will be found unrewarding by readers of The Lord of the Rings who, holding that the historical structure of Middle-earth is a means and not an end, the mode of the narrative and not its purpose, feel small desire of further exploration for its own sake...
The intent of History of Middle-earth is to present the texts that came to form the Silmarillion (with a slight diversion partway through into the LotR texts) in order of composition.
Neither is "more canonical" than the other. As Christopher Tolkien warns in his introduction to Unfinished Tales:
...the further knowledge of Middle-earth to be found in his unpublished writings will often conflict with what is already "known" ... In this book I have accepted from the outset that this must be so ... I have made no alterations for the sake of consistency with published works, but rather drawn attention throughout to conflicts and variations.
Likewise the texts presented in History of Middle-earth are often earlier versions that were subsequently superseded (and often contradicted) by later versions. They can include abandoned ideas, rejected texts, side-tracks that were never followed through on, and plans for revision that were never completed.
The most canonical texts in History of Middle-earth are probably those from volumes 10 and 11 (and to a lesser extent 12), which contain Tolkien's final words and final decisions on a lot of concepts, and which in many cases even supersede those published in the Silmarillion.