Shylock tells Antonio that if the three thousand ducats are not repaid in the stated time period, he will be allowed to extract one pound of Antonio's flesh. Antonio readily agrees because he is confident the ships that carry the returns of his investments will be safely into harbor well before the deadline. It is also suggested Antonio agrees in order to prove his superiority to Shylock, who he is in the habit of belittling and criticizing in public. As well, Antonio wishes to help his friend Bassanio by securing the loan for him (so that Bassanio can court Portia), so agrees to the terms so as not to disappoint Bassanio.
In The Merchant of Venice, Shylock loans Bassanio three thousand ducats without interest for a term of three months with Antonio backing Bassanio to guarantee the loan. One of the conditions of this loan is that Antonio must pay in a pound of flesh if he cannot repay the loan itself on time. Shylock inserts this term because of hid deep hatred for Antonio, who frequently lends money without asking for interest, thus, making Shylock's job as a lender more difficult.
Although Bassanio doesn't think Antonio should enter into the agreement, Antonio does so anyway, as he is very confidents that his ships (which will be arriving in two months) will bring him great wealth and that he won't encounter any difficulties in coming up with the money.