By default, when clicking the name of a document OneDrive through the browser it will open it in the Online version of the application it belongs to: Word, Excel, Visio, and PowerPoint. If you are opening documents that are PDFs or Photos, it will open them in a browser tab. Any other document type will force a download when opened from the browser due to the browser not having the correct application to launch the document. In the case you are opening a document that is not native to Microsoft Office, accessing your files through file explorer is recommended.
If you wish to open a Microsoft based document in its native application and bypass the online application, you can select the ellipses menu next to the document and select open in App. This will launch the app on your computer and open the file in the native app.