Stephen King says new book about imprisoned children 'imitates' US border crisis King realized "The Institute" paralleled current events during its final stages.

Author Stephen King says he never intended for his new book, "The Institute," to resemble the events happening at the US-Mexico border, but told "The View" on Wednesday the moment he realized there were parallels.

The brain behind best-selling horror novels like "The Shining," "The Stand," and "It" has a new novel that The New York Times says might be his "scariest novel yet."

The book takes place in suburban Minneapolis, where kidnappers murder a young boy's parents and take him to a place called The Institute. There, he discovers other children that have special gifts such as telekinesis and telepathy — just like him. As The Institute's staff attempt to extract the children's powers, they team up to attempt to escape and defeat evil.

On "The View," King explained his thought process behind the book and how it was just a coincidence that the plot was so similar to the humanitarian crisis at the U.S.-Mexico border.

"When I started this book, I just wanted to write a story about defenseless children who were locked up and had to kind of band together in order to fight these cruel adults that were performing tests on them," King said.

King said that he originally based his book on experiments performed by the CIA in the 1950s and concetration camps from World War II. But he said that he noticed the book ultimately taking on tones from the present day.

"I try to keep my politics separate from the stuff that I write," King said. "People like story. People want story and if they want the news...they can go on and get [it]."

"Sometimes, life comes along and imitates art instead of the other way around. As I was rewriting this book, all at once I found out we're locking little kids up in cages on the border, and I'm thinking to myself, this is like my book," King said referring to the migrant detention centers at the U.S.-Mexico border.

The number of migrants trying to cross the southern border into the U.S. has declined in recent weeks, with federal agents stopping 64,000 people in the month of August compared to a peak of 130,000 people in May, Acting U.S. Customs and Border Protection Commissioner Mark Morgan said on Monday.

Every episode of ABC's award-winning talk show "The View" is now available as a podcast! Listen and subscribe for free on Apple Podcasts, Google Podcasts, TuneIn, Spotify, Stitcher or the ABC News app.