Obscure, as is common among colloquialisms. OED mentions possible association with Dutch trappen, to tread or stamp the foot, but objects that the connection is unconvincing.
Pratique falar e memorizar " trapes " e muitas outras palavras e frases em inglês .