You are mixing webpack with yarn. The only use of yarn is to download javascript packages from
https://yarnpkg.com/lang/en/ to your app's node_modules folder. Webpacker is a gem that uses Webpack which is an assets manager/packer solution similar (but with conceptually different approach) to Sprockets (known as the rails' assets pipeline). Both Webpack and Sprockets can use the node_modules folder to find the required files.
You can use webpacker or sprockets on rails projects, you can even use both at the same time, the only difference between rails 5 and 6 is that 5 defaults to sprockets and 6 defaults to webpacker for new projects. You don't have to migrate to webpack if you don't want to, you should be able to upgrade to rails 6 without using webpack and everything should work as before.
Yarn won't create the /packs folder, webpacker should do that, maybe you didn't configure webpacker correctly or you didn't run the webpacker compiler. I suggest you follow the official webpacker guide to understand it
https://github.com/rails/webpacker#installation