First things first --> As per
Java laws, All the Runtime exceptions are thrown only by JVM. What we are trying to understand is -> What makes the JVM to throw this kind of an exception?
Ok, Lets take one at a time.
(1) IllegalArgumentException :
Java docs says that -> "Thrown to indicate that a method has been passed an illegal or inappropriate argument."
What this mean is -> Programatically, when the logic tries to pass wrong argument to a method, JVM detects that during Runtime and throws this exception.
(2) IllegalStateException
Java docs states -> "Signals that a method has been invoked at an illegal or inappropriate time. In other words, the Java environment or Java application is not in an appropriate state for the requested operation. "
What this mean is -> "The method invocation has happened (i.e the developer has written code to invoke the method during inappropriate time).
Hope this helps!