Well, it's up to the JVM to decide how it wants to allocate Thread IDs. That's not fixed by the specification. So it just appears that, in this case anyway, the JVM is doing it in a way that repeats every time.
You never need to know how thread IDs are allocated when writing code. The only thing that's defined is that the ID will be constant while the thread is alive, and two alive threads will never have the same ID.