This is slightly tricky as not everyone uttering that may have the same conception of truth, but generally speaking I think the definition only makes sense for some external/correspondence notion of truth.
As a prototypical example (although modern philosophical epistemology has mostly abandoned this viewpoint), in "standard" epistemic logic an agent can only know facts that are true in some external sense, because Kax → x, i.e. if agent a knows x then x is true from the logic's (external observer) standpoint. In contrast, the agent may believe facts that are not true in that sense. In formal terms, Bax does not imply x. Almost universally in these (logic) settings Kax implies Bax but not vice-versa.
As it's usually noted in contemporary texts, epistemic logic has been far more successful in computer science. In a multi-processor, unified main-memory setting for example, there is no dispute as what it means that location (bit) x in main memory is true, whereas a processor may or may not know this, depending on when x was last written relative to when a processor read it.
To give you a translation of that idea in a less technical setting: if Alice hides a treasure in some spot in the woods,
but Bob follows Alice without her noticing him and Bob digs up the treasure, then after that point we may say that
Alice believes the treasure is still buried at that spot but [we know] it's not true that the treasure is still buried there. You could argue that from Alice's standpoint, she still "knows" that fact to be true, but in the approach taken in epistemic logic, the fact is not true anymore from an external/objective standpoint. So in that strict (logic) framing, you cannot express that she knows something that turns out to be false (from an objective/external standpoint), but only that she believes something like that.
In a broader philosophical context, this kind of simple/strict theory of truth is obviously problematic. E.g. in epistemic reliabilism:
a particular justified belief may be false; however, its method or mode of acquisition must in general lead to true convictions.
(Emphasis mine. Quote from V.F. Hendricks Mainstream and Formal Epistemology.)
For example (in a continuation of the Alice-like example), you know where you [last] put your various things (e.g. in your house), and [thus] normally expect to still find them there. So on a usually reliable basis, you can claim you know where your things are.
Seeing the other answer, I'll add here that the Gettier problem isn't
that much related to the def of truth in JTB but with the issue of
distinguishing justification from luck. (Various reliabilitists have
claimed to have solved/addressed that too, but by additional means which
differ from merely adopting a reliabilist standpoint, although it's hard to say that any consensus has been reached on that.)