I think this answers the question very well, thank you.
I found this [1] documentation from Ruby explain what it solves pretty good aswell.
[1] https://docs.ruby-lang.org/en/3.0/syntax/pattern_matching_rd...
[1] https://docs.ruby-lang.org/en/3.0/syntax/pattern_matching_rd...