Substitution renames the letters. It does not change how often they occur, so the shape of the histogram survives the cipher. The tallest ciphertext bar is E. The next two are level, so counting single letters runs out here.
Frequency analysis, step by step
1. singles
T ×38 G ×36 Z ×36 Q ×33 K ×26 R ×25 L ×22 I ×21
map the tallest to E, then try the next two both ways.
2. digraphs
ZI ×9 IT ×8 GK ×8 ZG ×8 QF ×8 FR ×8
English: TH HE IN ER AN RE. Doubles: LL SS EE OO.
3. trigraphs
QFR ×7 ZIT ×5 GDG ×4 DGK ×4 IGX ×3
English: THE AND ING ION ENT.
4. other
one-letter words are A or I.
Everything above this line is a measurement. This is the attack. The counts hand you a partial map, the partial map hands you partial English, and reading the partial English hands you the rest. Run the three stages in order, then repair what they got wrong by typing over it.
Your map: ciphertext letter above, your guess below
A
B
C
D
E
F
G
H
I
J
K
L
M
N
O
P
Q
R
S
T
U
V
W
X
Y
Z
0 / 26 mapped
Ciphertext, and what your map recovers
LITLI
_____
GXSRI
_____
QCTRO
_____
TRITK
_____
TQYZT
_____
KZITK
_____
TVGXS
_____
RIQCT
_____
WTTFQ
_____
ZODTY
_____
GKLXE
_____
IQVGK
_____
RZGDG
_____
KKGVQ
_____
FRZGD
_____
GKKGV
_____
QFRZG
_____
DGKKG
_____
VEKTT
_____
HLOFZ
_____
IOLHT
_____
ZZNHQ
_____
ETYKG
_____
DRQNZ
_____
GRQNZ
_____
GZITS
_____
QLZLN
_____
SSQWS
_____
TGYKT
_____
EGKRT
_____
RZODT
_____
QFRQS
_____
SGXKN
_____
TLZTK
_____
RQNLI
_____
QCTSO
_____
UIZTR
_____
YGGSL
_____
ZITVQ
_____
NZGRX
_____
LZNRT
_____
QZIGX
_____
ZGXZW
_____
KOTYE
_____
QFRST
_____
SOYTL
_____
WXZQV
_____
QSAOF
_____
ULIQR
_____
GVQHG
_____
GKHSQ
_____
NTKZI
_____
QZLZK
_____
XZLQF
_____
RYKTZ
_____
LIOLI
_____
GXKXH
_____
GFZIT
_____
LZQUT
_____
QFRZI
_____
TFOLI
_____
TQKRF
_____
GDGKT
_____
OZOLQ
_____
ZQSTZ
_____
GSRWN
_____
QFORO
_____
GZYXS
_____
SGYLG
_____
XFRQF
_____
RYXKN
_____
LOUFO
_____
YNOFU
_____
FGZIO
_____
FU
__
Bold is the ciphertext; under each column is your map applied letter for letter, with _ wherever you have not guessed yet. The line does not have to be right to be useful: one word you recognize anywhere in it fixes several letters at once, and those letters open more words.
Frequency does not solve the cipher. It starts it. The stages come out wrong wherever the counts are ambiguous. Two letters tie, and rank order has to break the tie by guessing, so the map they build is a hypothesis, not an answer. What finishes the job is reading: the partial English above tells you which boxes to overwrite, and every correction makes the next one easier.
al-Kindi wrote this down around 850 CE, and it has never stopped working on a cipher that maps one letter to one letter. A machine does it without reading anything: score a candidate key by trigram log-probability, swap two letters, keep the swap when the score improves. Nothing searches 26!; the attacker walks downhill through it in seconds. The keyspace was never the defense.