If you have a diamond pickaxe with efficiency 5 in one slot and a wooden shovel with no enchantments on it in another slot, when you quickly switch between them and break grass or dirt or etc. you will break it like the shovel has efficiency 5. You can do this with any combination of tools. You can use the efficiency of a tool with another one. I did not test this with other enchantments. But it does not seem to work with unbreaking even if you switch quickly.
Thank you for your report!
We're tracking this issue in MC-272517, so this ticket is being resolved and linked as a duplicate.
If you would like to add a vote and any extra information to the main ticket it would be appreciated.
If you haven't already, you might like to make use of the search feature to see if the issue has already been mentioned.
Quick Links:
📓 Bug Tracker Guidelines – 💬 Community Support – 📧 Mojang Support (Technical Issues) – 📧 Microsoft Support (Account Issues)
📓 Project Summary – ✍️ Feedback and Suggestions – 📖 Game Wiki