Proteins are like that. The connections are chemical bonds; velcro, magnets and glue represent different structures on protein pieces that allow some kids of bonds to form with given strengths, and disallow others. The tumbling/shaking part is matter and temperature - in a living organism, everything mostly keeps bumping into everything else at random, and in particular, there's plenty of water molecules to push things around randomly. Pieces of protein thus keep connecting and disconnecting with other pieces, until the whole molecule reaches a stable state where the constant bumping isn't enough to break any of the bonds. That's how proteins fold.
Somehow, it turns out that any given protein tends to almost always fold into a very specific shape (which is currently impossible for us to compute a-priori, given just an ordered list of amino acid residues). But there are other possible shapes that a protein can sometimes reach, which are also stable but do not let it perform the functions the body needs it to. That's bad - such a protein is at best useless, at worst disruptive, and stability makes it hard for the body to get rid of it. Then there sometimes are stable shapes whose presence cause other similar proteins to fold to that same shape, instead of the one they'd ordinarily do - that's prions. That's very bad news. They reproduce through catalyzing creation of more of them, and their stability means they can just linger around after the host organism has died, and it's not easy to destroy them through boiling or denaturing agents.