Smart contracts are codes written by programmers or Devs on block chain to carryout a function. Once it is deployed on the block chain, this functions will be carried out without reversal.
Smart contracts can be used in various aspects of life in the cryptocurrency world both for good and bad purposes.
For instance this is how many scam smart contracts are written:
A programmer will write a smart contract code to allow users deposit their coins promising high ROI maybe like 20% in one day for 30 days and a bonus of 5% for referring, then he will try to build up the trust level by paying for some time to get more users involved and gain their trust.This will then bring in more users trusting and increasing their investments for a higher payout and even referring others as well. After the specified duration of this smart contracts expires, it auto terminate and do away with millions of crytocurrency.
In conclusion those smart contracts asking you to invest are not written by the wallet or the block chain developers, they can be written be any one who has the knowledge of how to write it and deployed to the block chain. Because many users believe these smart contracts are actually backed up or approved by the wallet or the block chain. Please be very careful with your funds.