One work A is "based on" another work B if A uses something from B, such as the basic story line. You can easily recognize B in A, but it has been transformed, changed. Things have been added, things have been left out.
It is "loosely based on" B if there are a lot of changes and the resemblance is not close.
For example, Walt Disney's "Alice in Wonderland" is "based on" Lewis Carroll's "Alice's Adventures in Wonderland," but there are many changes. Disney adds jokes that are not in the original, leaves out jokes that are, uses parts of both of the two different Alice books. Some lines follow the book closely, some do not. However, the names of most of the characters are the same--Alice, the White Rabbit, the Caterpillar, the Duchess, and so forth.
On the other hand, the musical "West Side Story" is _loosely_ (very loosely!) based on Shakespeare's "Romeo and Juliet." For example, the characters are named Tony and Maria rather than Romeo and Juliet; the story is set in 1950s New York City, U.S.A. instead of 1500's Verona, Italy; the characters do not sing in "Romeo and Juliet" but do in "West Side Story;" and so on and so on.