There can be a number of creak sources. Let me share my example.
I bought a bike with 28-spoke wheels. (Normally, I would not purchase a bike with anything less than 36 spokes per wheel, but unfortunately it has become hard to find bicycles with reasonable spoke count.)
Needless to say, the wheels lost spoke tension after riding a while. The front wheel lost all of its tension on all spokes, and the rear wheel only partially lost tension.
My solution for this was two-fold:
- I made a plan to build myself replacement 36-spoke wheels so that I can have wheels that won't fail
- I asked the bike shop where I purchased the bike from to fix the existing wheels
The "solution" of the bike shop was to put thread glue into every spoke nipple, and to slightly tighten the spokes. After I got the bike back, I rode it for 700 km or so with the "fixed" wheels before building my own wheelset. Upon carefully inspecting the "fixed" wheels, spoke tension on the average was low, wildly fluctuating (so not equivalent on every spoke) and it appeared what kept the spoke nipples from unscrewing was the thread glue.
The spokes on the "fixed" wheelset didn't unscrew anymore due to the thread glue, but a different problem developed on the rear wheel. When riding hard uphill, there was a mysterious creak. I originally assumed the creak would come from a bent rear wheel axle, but now I assume the creak actually came from the spokes, some of which still had inadequate tension.
My replacement rear wheel that I myself built with DT Swiss TK 540 rim, DT Swiss Alpine III spokes, DT Swiss Pro Head brass nipples, and Shimano FH-R7070 hub, did not suffer from the problem at all. Obviously I did not use any thread glue, put enough tension on all spokes, ensured the spoke tensions were equal, stress relieved the wheel carefully in addition to ensuring the wheel is true.
Of course it's theoretically possible that the original rear wheel having a cheap non-Shimano "Formula" hub could have something broken, but I believe it is a plausible theory that the rear wheel spokes are creaking when riding uphill.