Sometimes, a virus or malware attack can also make your desktop icons or dock disappear.A broken firmware process or tamper with macOS can also cause the same.
A clash between some other kernel and local OS process could have caused the issue.There might be some change in the overall display or system settings on Mac.Mac settings would have been altered during an update or OS repair.A third-party application could have changed your desktop settings.The chances are that you might have disabled the dock or taskbar.You could have accidentally deleted a file or icon from the desktop.