Apple's Continuity Camera feature in macOS Mojave and later allows you to use your iPhone or iPad like a camera extension for your Mac. In other words, you can use your iOS device to scan documents or take a photo of something nearby, and it will appear instantly on your Mac.
Continuity Camera works in many Mac apps, including Finder, Preview, Notes, Mail, Messages, TextEdit, Keynote,...