Mr Liu Yijun, 26, grew up in a family that was not particularly religious, although his parents might go to the temple occasionally and he would tag along without understanding what it was about.
It was only after leaving home in Meizhou city, Guangdong province, in his teens that he came into closer contact with religion.
He first encountered Christianity at a missionary school in Hong Kong and then Buddhism at university in Guangzhou and Beijing.
As a young student living far from home "I had a lot of worries", he said, whether it was over relationships with the people around him or with his parents. He also got to thinking about the meaning of life and questions about life and death. That was how he turned to religion.
Now a graduate student of traditional Chinese medicine (TCM) in Beijing, Mr Liu practises Buddhism, chanting Buddhist scriptures daily.
Unlike Mr Liu, Mr Ma Fuyun, 34, grew up in a strict Muslim family in a Hui minority community in Qinghai province. But it was only after leaving home to study in Beijing that he understood Islam more and became more steadfast as a Muslim.
"Before I left home, I was believing blindly in Islam," said the post-doctoral student in TCM.
Away from home, he came into contact with other religions which he at first felt repelled by, but which he came to accept as different ways of searching for the origins of life.
Most importantly, in his darkest moments of depression when he contemplated suicide, his faith prevented him from doing so, as suicide is not allowed in Islam.
The spiritual journey of both men has been that of many in China since after the Cultural Revolution, the period in Chinese history from 1966 to 1976 when religion was attacked and suppressed as part of a campaign to destroy old customs, culture, habits and ideas.
Temples, churches and mosques were destroyed and clergy tortured, sent to re-education camps and even killed.
As China embarked on reforms and opened up to the outside world from 1978, the atheist Chinese Communist Party (CCP) changed its approach to religion from that of eradication to one of regulation.
It sought to "manage religion, harness its influence to achieve other party goals and suppress any threat it may present to the party's authority", said a 2017 report on religion in China today by Freedom House, an American non-governmental organisation.
"In the background was the Marxist assumption that, with further economic development, 'feudal' religious beliefs would inevitably fade," the report added.
After decades of varying degrees of suppression under the CCP since 1949, religion and spirituality, long part of China's society, began to make a comeback from the 1980s.
The reasons are myriad.
There was the crisis of faith in the communist ideology in the post-Mao Zedong era, noted Professor of World Christianity Lian Xi of Duke University in the United States.
"The Cultural Revolution (unleashed by Mao) and its excesses had undermined the communist faith," he explained. The Tiananmen incident of June 4, 1989 - where hundreds, even thousands, of pro-democracy demonstrators were killed - destroyed communism as a faith for the people, he added.
Religion filled the spiritual vacuum that emerged.
Also, as China emerged from its isolation and as Chinese began to travel abroad, they saw that religion was not backward and that advanced countries were not secular, as they had been told. Instead, they saw that Christianity was strong in the US, Islam vibrant and Buddhism popular in countries like Japan and Singapore, said Professor Dru Gladney of Pomona College in the US.
This led to a fascination with religion among the Chinese, he added.
As China loosened its hukou or residential permit system to allow internal migration to facilitate economic development, religion also found room to grow.
Islam spread from the western provinces, where Muslims were concentrated, to the coastal provinces in the east - which hitherto had small Muslim communities - as Muslim traders and workers moved east to take advantage of the growing economic activity there.
In the trading city of Yiwu in Zhejiang province, for example, the number of Muslims grew from just 400 in 1982 to about 35,000 in 2012.
The mass migration of Chinese workers has led to the dislocation of many from their families and traditional communities, and religion offers them the connectedness and community they otherwise lack.
For Madam Li Feng (not her real name), 63, who came to Beijing from central Henan province two years ago to look after her grandson, being a member of a small church gave her just that.
In church, she belongs to a cell group of women around her age, many of whom, like herself, have come from their hometowns in provinces as far flung as Sichuan, Heilongjiang and Henan to take care of grandchildren or to work.
"We encourage each other and comfort each other," she said.
Religious communities also offer a social safety net.
As China's economy liberalised, its old "cradle to grave" social security system that supported workers through ill health, economic hardship and old age has broken down. While the state has sought to create a new social security system, it is not yet adequate.
"For people who are insecure about their future, being part of a religious community, whether it is Christian, Muslim or Buddhist, offers a support system that traditionally the state offered in the past, but which, with China's rapid development, the state has not kept pace with," said Prof Gladney.
While all major religions have seen an uptick in the numbers of followers, Christianity is seen to be the fastest growing.
Some estimate that the number of Christians has grown by about 10 per cent a year since 1980. According to Freedom House, there are 250 million Chinese Buddhists, eight million Tibetan Buddhists, 80 million Protestants, 12 million Catholics, 23 million Muslims and 20 million Falungong followers.
However, as the numbers grow, control over religious practices has been tightened in recent years.
Said the Freedom House report: "Since Xi Jinping took the helm of the Chinese Communist Party in November 2012, the authorities have intensified many of their restrictions, resulting in an overall increase in religious persecution."
These include restrictive new laws; expanding targets of repression to include previously tolerated activities and individuals; increased state intrusion in daily life such as constraining of children's religious education and participation; and use of electronic surveillance at places of worship.
Said Prof Lian: "The recent hardening of the religious policy reflects the state's increased fear that religion can undermine the state's control, prestige and its claim to truth."
The hardest-hit religions, he added, are Tibetan Buddhism, Islam in Xinjiang region and Christianity in general. In particular, as many as one million Muslims - mostly from the Uighur minority group - in Xinjiang have been sent forcibly to re-education camps in a bid to "de-extremify" them, a move that has been condemned by the United Nations.
The Chinese government has defended the camps, saying they are vocational training centres meant to deal with Islamic extremism.
In cracking down on religion, however, the government is depriving itself of societal resources to cope with an array of problems and needs faced by the people, from earthquake relief to care for the poor or jobless or the disabled or mentally ill, said Prof Lian.
This is because religious communities have provided many services and met both the material and emotional needs of the people beyond what the state is capable of doing.
Religious control exacerbates popular distrust and resentment against the government and "will inevitably sow the seeds of radical or eschatological religion which will turn believers against the government", he warned.
Ms Aileen Li (not her real name), 40, a marketing executive and a Christian, said that while the government's harsh actions may yield results in the short term, it is impossible to control religion for long.
"This is because it runs counter to the needs of the people," she said.