What's the theory behind this? (Or does it NOT 'work'?)
I'm hesitant to answer this, because by your own admission you can't define "work," which suggests you might not even know when a proper answer has appeared. Furthermore, you give no hints as to style; an answer to this question in a first-semester harmony course would be very different from the answer in a sixth-semester course for composition majors. But I'll offer some thoughts.
From a strict Schenkerian standpoint, one could say that this doesn't "work." By this I mean that this progression does not fit within the framework of Schenkerian theory.
In the abstract to "The ♯IV(♭V) Hypothesis: Testing the Limits of Schenker's Theory of Tonality," the authors state that
Our ♯IV/♭V Hypothesis is based on Schenkerian theory's predictions that if ♯IV/♭V sonorities appear in a tonal context, then they are always indirectly related to the tonic; thus, whenever ♯IV/♭V Stufen are interpreted as being directly related to the tonic or are not explainable in a convincing way as indirectly related, either the analysis is incorrect or the work must be deemed non-tonal.
As your excerpt is currently written, I don't see a way to interpret your F♯ (that is, ♯IV) as being anything but directly related to tonic, because there are no chords other than tonic to which it could relate.
Furthermore, the F♯ is a tritone away from C, and the C is a tritone away from F♯. This means that, from a purely tonal standpoint, it's impossible to tell which pitch is tonic since each chord is equidistant from the other. (Metrical concerns, however, do give C a slight edge.)
Schenkerian Theory, Part II
If, however, you attach a D and G chord at the end, we could view the F♯ as combined with the D creating applied motion to G (V). In doing so, we no longer relate the ♯IV to tonic, but rather to V. This then qualifies as a correct tonal progression within the Schenkerian framework.
Note that that is only one way to fit this progression into a Schenkerian framework. Another would be to insert an E♭ chord between the C and F♯. Doing so that causes us to reinterpret the F♯ as G♭, and we might then interpret the G♭ as ♭III of ♭III (that is, ♭III of E♭).
From a neo-Riemannian standpoint, we can view this as a PRPR transformation:
P(C) = Cm (read as "The parallel of C is Cm." R(Cm) = E♭ (read as "The relative of Cm is E♭.") P(E♭) = E♭m R(E♭m) = G♭ = F♯
Perhaps unexpectedly, this is in line with the second Schenkerian interpretation of ♭III/♭III.
All of this is to say that the answer all depends on how you define "work."
But I hope you aren't trying to point out that questions that ask how something "works" are not fit for this site. There's a big difference between questions about mode mixture and applied chords (which both date back to the 18th century at least!) and the quintessential tonality-defying progression of two chords a tritone apart.
In the commentary below the question, it seems like the definition of a chord progression "working" is part of what needs to be addressed here. I can't speak for anyone else, but when I see questions like this I tend to interpret them as something more like "X progression seems to be outside the world of basic common-practice theory, but I nevertheless hear it as a reasonable harmonic connection. What is the nature of X that makes it sound like a reasonable connection despite its apparent deviation from basic theory?"
Framed in that way, there are several possible responses (assuming the questioner is correct that X isn't already clearly a part of basic common-practice theory): 1) Actually, this is a thinly veiled version of a thing that really is fairly standard; 2) although X doesn't follows such and such constraints of basic theory, it does follow such and such other constraints in a way that offsets it; or 3) this is far enough outside the norms of basic theory that the reason it works might well be its divergence from standards.
Implicit in all of this is the fact that, for the most part, something "working" ultimately just means some person likes it. For instance, I don't recognize the example you provide, but it isn't particularly to my taste. In one sense I might say that it doesn't "work." But if we engage with the discussion from that angle, we gain very little—you like it, I don't, but we haven't really learned anything beyond each others' opinions. Objectively speaking, we have to acknowledge that, somewhere out there, for virtually any possible combination of notes there's at least somebody that likes it. It "works" for them. My job, in answering the question on a site like this, is therefore to offer possible music-theoretical reasons for the potential usefulness or interest in a particular progression and to explain it.
So with this particular example, I think I'd go somewhere in between answer 2) and 3) above. One thing that potentially works (in a #3 sense) in this progression is its flouting of the norms of root progressions standard to a lot of Western music. It forces a striking "freshness" to the combination despite its repetition. It contains a cross-relation (C–C#) which directly contradicts the presumed tonic and forcefully defies categorization into any particular major/minor key. In fact, as others point out, the strict symmetry of a tritone relation (F# precisely bifurcates a C–C octave and vice-versa) injects a potentially exciting tension between two different tonal centers with each chord potentially both the "away" and the "home" harmony. Only metric emphasis tends to privilege either.
Contrasting a bit with that freshness, however, is the relative closeness of two notes in the chords in terms of pure parsimonious voice leading. The C and the G need only move (in contrary motion no less!) a single half step to reach C# and F#, leaving a reflection of the tritone root relation in the distance between E and A#. Alternatively, the C could be heard as splitting into one half-step motion up to C# and one whole step motion down to A#(Bb) while the E and the G converge on F# with a whole and half step respectively. Contrary to your comment on the question, these parsimonious connections tend to be heard as significant regardless of whether they are pursued on the surface of the music. To be sure, if I play a C major chord down low and then play an E minor chord up high, then I am significantly lessening the surface connection of the chords by ignoring the two potential common tones. But the latent connection between them and octave equivalence would lead it to still have a significant connective impact. The surface certainly doesn't always follow the connections literally, but that doesn't mean they aren't affecting the sound of the connection.
Add to this the fact that the two chords are connected by having the same quality, and we have some elements providing a few close(ish) connections with a few other elements providing significant tension. Such combinations can be quite compelling, despite (or because of?) this particular one being extremely rare in the common practice era.