Difference between Docker and LXD?

I see articles/posts saying that Docker is used for applications, and LXD for virtual machines. But I can use Docker with an OS image like Ubuntu. Is that considered an application? Since LXD is for virtual machines, does that mean it would use more memory/cpu than docker when running the same thing on both?

Can anyone give me any specific examples of what I can do with one of them, that I can’t do with the other?

Thank you.