Have you ever used gmail in your Android or iOS using your browser. While browsing it you get a small popup at the top saying that to view/install the native gmail app available at Google Play or AppStore. How do you do that? Is that feature done using html, css, and JS. Or is it built-in to native app?
By the way, this doesn't happen only for gmail but pretty much all the professional apps with both web apps and native apps.
On iOS, you're thinking of Smart App Banners, which are a website configuration detail to display a banner for the user to view your iOS app in the App Store: