It's a chain tensioner for a bike with an internally geared rear hub (Shimano Alfine specifically) but there are lots of chain tensioners out there, I picked up this one because it was $25 and available. You may hear people talk about shortening their chain if they break a rear derailleur and just running it as a single speed, which works great on some bikes, but I have a Specialized Levo and their rear suspension has a ton of chain growth as it moves through the travel so I don't think that is a super practical way to go, but as soon as I say that watch someone else do it no probem. So I picked up this chain tensioner so I could ride in a single gear for the next couple of weeks until the new rear wheel and derailleur I ordered arrive, but as I looked at it I thought, might not be a bad spare to just keep with me as I am a bit hard on bike parts. If you wanted to buy something specifically to keep as a spare though you could find smaller lighter units, maybe a single pulley unit like a Surly Singulator or one of it's competitors. They are sold for bikes with a single cog in the rear, so you can find them either for single speed conversions, or rear hub conversions like the Alfine and the Rohloff units.
You align them by shimming them from the ones I have seen. This one came with two 2mm washers and a 1m washer so you can mix and match from 1-5mm of offset.