I think the most important line of @alexander 's response is the first line. A huge chunk of musical theory emerges from the fact that the diatonic scale traverses the octave in a characteristic sequence of intervals that repeats itself. One way of looking at that pattern is the major scale, in which case those intervals are layed out as follows: W-W-H-W-W-W-H. The minor scale is W-H-W-W-H-W-W, which is just looking at the same repeating sequence of intervals from a different starting point.
C-D-E-F-G-A-B-C-D-E-F-G-A-B-C-D-E-F-G-A-B
W-W-H-W-W-W-H-W-W-H-W-W-W-H-W-W-H-W-W-W-H
^ ^ ^
A-B-C-D-E-F-G-A-B-C-D-E-F-G-A-B-C-D-E-F-G
W-H-W-W-H-W-W-W-H-W-W-H-W-W-W-H-W-W-H-W-W
^ ^ ^
C major and A minor are the only diatonic scales where the interval pattern falls in such a way that all the tones line up with the “Natural” note names of the staff (strictly speaking, the other 5 “modes” of C major also line up with the natural note names, e.g. D Dorian, E Phrygian, F Lydian, G Mixolydian, B Locrian).
Per @Ian 's excellent post in another thread, as keyboard instruments developed, they came to adopt the convention of placing those naturally named notes on the “white keys”, and placing the remaining 5 notes of the chromatic scale on the “black keys”.
Because we can see that our musical system has 12 notes in any octave (with an equal intervalic distance between any two adjacent notes), It should be intuitively obvious that regardless of note names or “white keys versus black keys”, we can construct a 12 tone chromatic scale using any note as the starting point. The interval pattern for this would be H-H-H-H-H-H-H-H-H-H-H-H. The chromatic scale can be thought of as a sequence of intervals that gets you from your starting note to the note one octave highter. There’s no reason we can’t use an artbitrary note as a starting point, and rather than ascend through the pattern of the chromatic scale, ascend through the pattern of the major scale (or any diatonic scale). So in the case of the major scale: W-W-H-W-W-W-H. If we do this with the major scale using any note other than C natural as the starting point, our pattern will end up falling onto some notes that have “non-natural” names (i.e. “the black keys” on the piano). As @alexander 's post mentions, we assign names to these “non-natural” notes BASED ON THE CONTEXT IN WHICH THEY ARE PLAYED, avoiding using the “letter” part of the note name more than once within the same scale.
So for a scale that includes E natural, for example, if the same scale includes the note one half-step below E natural, we will avoid calling that note “E flat” to prevent having two “Es” in the scale, and will instead call it “D sharp”. In contrast, for a scale that includes D natural and the note one half-step above D natural, we will avoid calling that note “D sharp”, and will instead call it “E flat”.
And regarding the circle of fifths in general, check out this video by Michael New: