You have a section of threads that seal or have a gasket. This is simpler than a relief valve that can leak or collect bacteria.

The cap is rigid. Either the threads constrain movement or they don't. A section of threads that allow for movement would still find the overall system constrained by other threading.